<!DOCTYPE html>
<html>

	<head>
		<title>我的消息</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/plugins/bootstrap-4.1.1-dist/css/bootstrap.min.css">
		<script src="/js/plugins/jquery/jquery.min.js"></script>
		<script src="/js/plugins/jrender/jrender.min.js"></script>
		<script src="/js/plugins/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/message.css" />

		<script>
			//查询 赞数，评论数，私信数和系统通知数
			$(function () {
				$.get("/messages",function (data) {
					var result = data.result;
					if(result.upvokeNum!=0){
                        $("#upvokeNum").html(result.upvokeNum);
					}
					if(result.commentNum!=0){
                        $("#commentNum").html(result.commentNum);
					}
                    if(result.letterNum!=0){
                        $("#letterNum").html(result.letterNum);
                    }
                    if(result.noticeNum!=0){
                        $("#noticeNum").html(result.noticeNum);
                    }
                })

                //获取系统消息
				$("#system").click(function () {
					$.get("/messages/systems",function (data) {
                        var list = data.list;
                        var temp;
                        $.each(list,function (index, item) {
                            temp="<dd>" +
                                "<p>"+item.content+"</p> " +
                                "<p>-- 骡窝官方</p>" +
                                "<p>"+item.createTime+"</p>" +
                                "</dd>";
                           $(".itemList").append(temp);
                        })
                    });
					$("#noticeNum").html("");
                });

            })
		</script>
	</head>

	<body>
		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a href="javascript:history.go(-1);">
						<span><i class="fa fa-chevron-left" ></i></span>
					</a>
				</div>
				<div class="col">
					<span>我的消息</span>
				</div>
				<div class="col"></div>
			</div>
		</div>

		<ul class="list-group">
			<a href="/mine/upvokeMsg.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-thumbs-o-up" ></i></span>
						<span>赞</span>
						<span class="badge badge-danger badge-pill" id="upvokeNum"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<!--<a href="../index.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-at" ></i></span>
						<span>@我的</span>
						<span class="badge badge-danger badge-pill">2</span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>-->
			<a href="/mine/commentReplyMsg.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-commenting-o" ></i>	</span>
						<span>评论</span>
						<span class="badge badge-danger badge-pill" id="commentNum"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/letterMsg.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-envelope-o" ></i></span>
						<span>	私信</span>
						<span class="badge badge-danger badge-pill" id="letterNum"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="javascript:" id="system">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-bell" ></i></span>
						<span>系统通知</span>
						<span class="badge badge-danger badge-pill" id="noticeNum"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
		</ul>
		
			<div class="container systemMsg">
					<dl class="itemList">
						<!--<dd>
							<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p> 
							<p>&#45;&#45; 阿尔伯特·爱因斯坦</p>
							<p>32分钟前</p>
						</dd>
						<dd>
							<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p> 
							<p>&#45;&#45; 阿尔伯特·爱因斯坦</p>
							<p>32分钟前</p>
						</dd>
						<dd>
							<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p> 
							<p>&#45;&#45; 阿尔伯特·爱因斯坦</p>
							<p>32分钟前</p>
						</dd>-->
					</dl>
			</div>

	</body>

</html>